<?php

namespace Drupal\shushengyuan\Schemas;

use Drupal\shusy_taxation\Entity\ShusyTaxation;

/**
 * @OA\Schema(
 *   schema="MyTeamItem",
 *   type="object",
 *   description="MyTeamItem"
 * )
 */
class MyTaxationItem extends AbstractBaseModel {

  protected function getEntityType() {
    return 'shusy_taxation';
  }

  protected function setValue() {
    if ($this->entity instanceof ShusyTaxation) {
      $value = [
        /**
         * @OA\Property(
         *   property="id",
         *   type="integer",
         *   description="ID",
         * ),
         */
        'id' => (int) $this->entity->id,
        /**
         * @OA\Property(
         *   property="name",
         *   type="integer",
         *   description="name",
         * ),
         */
          'name' => (string) $this->entity->name,
        /**
         * @OA\Property(
         *   property="store_name",
         *   type="integer",
         *   description="store_name",
         * ),
         */
          'store_name' => (string) $this->entity->store_name,
        /**
         * @OA\Property(
         *   property="store_title",
         *   type="integer",
         *   description="store_title",
         * ),
         */
          'store_title' => (string) $this->entity->store_title,
          'sex' => (string) $this->entity->sex,
          'ages' => (string) $this->entity->ages,
          'identity' => (string) $this->entity->identity,
          'phone' => (string) $this->entity->phone,
          'remake' => (string) $this->entity->remake,
          'doctor' => (string) $this->entity->doctor,
          'faith' => (string) $this->entity->faith,
          'faiths' => (string) $this->entity->faiths,
        /**
         * @OA\Property(
         *   property="price",
         *   type="integer",
         *   description="price",
         * ),
         */
          'price' => (string) $this->entity->price,
        /**
         * @OA\Property(
         *   property="doctor",
         *   type="integer",
         *   description="doctor",
         * ),
         */
          'status' => (string) $this->entity->status,
        /**
         * @OA\Property(
         *   property="nowdate",
         *   type="integer",
         *   description="nowdate",
         * ),
         */
          'nowdate' => (string) $this->entity->nowdate,
          'doctoroimg' => $this->imageStyleUrl('StoreTaxationItemDoctoroimg', file_load($this->entity->doctoroimg)),
          'doctoroimg01' => $this->imageStyleUrl('StoreTaxationItemDoctoroimg', file_load($this->entity->doctoroimg01)),
          'doctoroimg02' => $this->imageStyleUrl('StoreTaxationItemDoctoroimg', file_load($this->entity->doctoroimg02)),

          'doctoroimgl' => $this->imageStyleUrl('StoreTaxationItemDoctoroimg', file_load($this->entity->doctoroimgl)),
          'doctoroimgl01' => $this->imageStyleUrl('StoreTaxationItemDoctoroimg', file_load($this->entity->doctoroimgl01)),
          'doctoroimgl02' => $this->imageStyleUrl('StoreTaxationItemDoctoroimg', file_load($this->entity->doctoroimgl02)),

          'doctoroimgr' => $this->imageStyleUrl('StoreTaxationItemDoctoroimg', file_load($this->entity->doctoroimgr)),
          'doctoroimgr01' => $this->imageStyleUrl('StoreTaxationItemDoctoroimg', file_load($this->entity->doctoroimgr01)),
          'doctoroimgr02' => $this->imageStyleUrl('StoreTaxationItemDoctoroimg', file_load($this->entity->doctoroimgr02)),

          'doctoroimgs' => $this->imageStyleUrl('StoreTaxationItemDoctoroimg', file_load($this->entity->doctoroimgs)),
          'doctoroimgs01' => $this->imageStyleUrl('StoreTaxationItemDoctoroimg', file_load($this->entity->doctoroimgs01)),
          'doctoroimgs02' => $this->imageStyleUrl('StoreTaxationItemDoctoroimg', file_load($this->entity->doctoroimgs02)),

          'doctoroimgsl' => $this->imageStyleUrl('StoreTaxationItemDoctoroimg', file_load($this->entity->doctoroimgsl)),
          'doctoroimgsl01' => $this->imageStyleUrl('StoreTaxationItemDoctoroimg', file_load($this->entity->doctoroimgsl01)),
          'doctoroimgsl02' => $this->imageStyleUrl('StoreTaxationItemDoctoroimg', file_load($this->entity->doctoroimgsl02)),

          'doctoroimgsr' => $this->imageStyleUrl('StoreTaxationItemDoctoroimg', file_load($this->entity->doctoroimgsr)),
          'doctoroimgsr01' => $this->imageStyleUrl('StoreTaxationItemDoctoroimg', file_load($this->entity->doctoroimgsr01)),
          'doctoroimgsr02' => $this->imageStyleUrl('StoreTaxationItemDoctoroimg', file_load($this->entity->doctoroimgsr02)),
        /**
         * @OA\Property(
         *   property="user",
         *   ref="#/components/schemas/User",
         *   description="下级用户",
         * ),
         */
        'user' => User::get($this->entity->uid),
      ];
      $this->merge($value);
    }
  }
}
